package com.codefish.util;


import cn.hutool.core.util.StrUtil;
import com.codefish.exception.RRException;

/**
 * 数据校验
 *
 * @author dengfan 283105211@qq.com
 */
public abstract class Assert {

    public static void isBlank(String str, String message) {
        if (StrUtil.isBlank(str)) {
            throw new RRException(message);
        }
    }

    public static void isNull(Object object, String message) {
        if (object == null) {
            throw new RRException(message);
        }
    }

    public static void isNullOrZero(Number number, String message) {
        if (number == null || number.doubleValue() == 0) {
            throw new RRException(message);
        }
    }
    
    public static void isFalse(Boolean bool, String message) {
        if (false == bool) {
            throw new RRException(message);
        }
    }
}
